package com.molichuxing.services.infrastructure.dao;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.services.infrastructure.bean.FenceStoreStockBean;
import com.molichuxing.services.infrastructure.dto.response.FenceCountDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 门店中转库围栏信息 Mapper 接口
 * </p>
 *
 * @author zph
 * @since 2020-02-20
 */
public interface FenceStoreStockMapper extends RootMapper<FenceStoreStockBean> {

    /**
     * 围栏数量
     *
     * @return
     */
    List<FenceCountDto> getFenceCount(@Param("storeIds") List<Integer> storeIds, @Param("type") Integer type);

    /**
     * 批量添加围栏
     *
     * @param fenceStoreStockBeanList
     * @return
     */
    int createFenceBatch(List<FenceStoreStockBean> fenceStoreStockBeanList);

    /**
     * 根据门店或中转库id获取围栏id
     *
     * @param storeId
     * @param type
     * @return
     */
    List<Integer> getFenceByStoreId(@Param("storeId") Integer storeId, @Param("type") Integer type);

    /**
     * 解除围栏
     *
     * @param storeId
     * @param type
     * @param fenceId
     * @return
     */
    int deleteFence(@Param("storeId") Integer storeId, @Param("type") Integer type, @Param("fenceId") Integer fenceId);

    /**
     * 根据围栏id查询围栏信息
     *
     * @param fenceIdList
     * @return
     */
    List<FenceStoreStockBean> getFenceByFenceIdList(@Param("fenceIdList") List<Integer> fenceIdList);

    /**
     * 获取所有围栏id
     *
     * @return
     */
    List<Integer> getAllFenceIdList();

    /**
     * 根据围栏storedis获取绑定围栏Id
     * @param storeIds
     * @param type
     * @return
     */
    List<Integer> getFenceIdByStoreIds(@Param("storeIds") List<Integer> storeIds, @Param("type") Integer type);

    /**
     * 根据围栏id返回 围栏id, storeId
     * @param fenceIds
     * @param type
     * @return
     */
    List<FenceStoreStockBean> getStoreIdByFenceIds(@Param("fenceIds")List<Integer> fenceIds, @Param("type")Integer type);
}